home *** CD-ROM | disk | FTP | other *** search
- ;-------------------------fptnorm routine begins--------------------------+
- ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
- ; page : 84
- ;
- ; NAME FPTNORM
- ; ROUTINE FOR NORMALIZATION OF TEMPORARY FLOATING POINT
- ;
- ; FUNCTION: This routine normalizes temporary binary floating point
- ; numbers that have too large a mantissa.
- ;
- ; INPUT: Upon entry DS:DI points to a temporary binary floating point
- ; number whose mantissa is too large
- ;
- ; OUTPUT: Upon exit DS:DI points to a normalized temporary binary floating
- ; point number.
- ;
- ; REGISTERS USED: No registers are modified. DI must point to the number
- ;
- ; SEGMENTS REFERENCED: The data segment must contain the temporary
- ; floating point number.
- ;
- ; ROUTINES CALLED: None
- ; SPECIAL NOTES: Equates are used to shorten address fields. This is a
- ; near procedure needed by FPIN.
- ;
- ; ROUTINE TO NORMALIZE TEMP FLO-ATING POINT NUMBERS THAT HAVE TOO LARGE
- ; A MANTISSA.
- ;
- fptnorm proc near
- ;
- cmp diword+8,100h ; test if too high
- jl fptnorm1 ; exit if low enough
- sar diword+8,1 ; shift right all bytes
- rcr diword+6,1 ; carry on
- rcr diword+4,1
- rcr diword+2,1
- rcr diword+0,1
- inc diword+11 ; increment exponent
- jmp fptnorm
- ;
- fptnorm1:
- ret ; return
- ;
- fptnorm endp
- ;-------------------------fptnorm routine ends---------------------------+